package ru.ifmo.ipimenov.ewf_svn.standalone.service.impl;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import ru.ifmo.ipimenov.ewf_svn.standalone.dao.DocumentDao;
import ru.ifmo.ipimenov.ewf_svn.standalone.dao.RulesDao;
import ru.ifmo.ipimenov.ewf_svn.standalone.dao.impl.DocumentDaoHibernate;
import ru.ifmo.ipimenov.ewf_svn.standalone.dao.impl.RulesDaoHibernate;
import ru.ifmo.ipimenov.ewf_svn.standalone.model.db.Document;
import ru.ifmo.ipimenov.ewf_svn.standalone.model.db.User;
import ru.ifmo.ipimenov.ewf_svn.standalone.model.db.Rules;
import ru.ifmo.ipimenov.ewf_svn.standalone.service.DocumentService;
import ru.ifmo.ipimenov.ewf_svn.standalone.service.RulesService;

import java.util.List;

/**
 * @author: Ilya Pimenov
 * Scartel Starlab company
 */
public class RulesServiceImpl implements RulesService {
    /**
     * Logger for all purposes
     */
    private static Log log = LogFactory.getLog(DocumentServiceImpl.class);

    private RulesDao dao;

    public RulesServiceImpl() {
        dao = new RulesDaoHibernate();
    }

    public List<Rules> load(Document d) {
        return dao.list(d);
    }

    public void save(Rules r) {
        dao.save(r);
    }

    public void delete(Rules r) {
        dao.delete(r);
    }
}